package org.jslaughter.event.eventtype;

import org.nvframe.entity.Entity;
import org.nvframe.event.AbstractEvent;
import org.nvframe.event.EventListener;

/**
 * 
 * @author Nik Van Looy
 */
public class ExplosionEvent extends AbstractEvent {

	private static Class<? extends EventListener> listener = ExplosionListener.class;
	
	private Entity source;
	private Entity target;
	private int damagePoints;

	public ExplosionEvent(Entity source, Entity target, int damagePoints) {
		// set event-specific properties
		this.damagePoints = damagePoints;
		this.source = source;
		this.target = target;
	}
	
	public void dispatchToListener(EventListener listener) {
		((ExplosionListener) listener).onExplosion(this);
	}

	public Entity getSource() {
		return source;
	}
	
	public Entity getTarget() {
		return target;
	}

	public int getDamagePoints() {
		return damagePoints;
	}	

	@Override
	protected Class<? extends EventListener> getListener() {
		return listener;
	}
}

